//
//  GHOrderTableViewCell.m
//  GodHorses
//
//  Created by Mac on 2017/11/17.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "KLDoctorListTableViewCell.h"

@interface KLDoctorListTableViewCell ()

@property(nonatomic, strong) STLabel                         *titleLable;//名字
@property(nonatomic, strong) STLabel                         *desLable;//描述

@end
@implementation KLDoctorListTableViewCell

+ (CGFloat)cellHeight{
    return 120;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
#pragma mark --subView
- (void)configSubView{
    self.backgroundColor = [UIColor whiteColor];

    
    self.iconButton = [[STButton alloc] initWithFrame:CGRectMake(15, 20, 66, 66)
                                                     title:nil
                                                titleColor:nil
                                                 titleFont:0
                                              cornerRadius:33
                                           backgroundColor:nil
                                           backgroundImage:[UIImage imageNamed:@"06"]
                                                     image:nil];
    [self addSubview:self.iconButton];
    
    self.contactButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 60, 25)
                                                     title:@"问医生"
                                                titleColor:FlatWhite
                                                 titleFont:15
                                              cornerRadius:5
                                           backgroundColor:KL_BlueBackGroundColor
                                           backgroundImage:nil
                                                     image:nil];
    self.contactButton.right = UIScreenWidth - 15;
    self.contactButton.top = self.iconButton.top + 5;
    self.contactButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [self addSubview:self.contactButton];
    
    
    self.titleLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right + 10, self.iconButton.top + 5, self.contactButton.left - 20 - self.iconButton.right, 20)
                                                text:@"name"
                                           textColor:KL_firstTextColor
                                                font:16
                                         isSizetoFit:NO
                                       textAlignment:NSTextAlignmentLeft];
    self.titleLable.numberOfLines = 0;
    [self addSubview:self.titleLable];
    
    
    self.desLable = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right + 10, self.titleLable.st_bottom  +10 , self.contactButton.right - self.iconButton .right - 20, 40)
                                              text:@"的萨克打算离开的卡里时间打开来说大家案件达可莱丝建档立卡埃及大垃圾打开了圣诞节案列建设大路时间多拉升等级阿拉斯加"
                                         textColor:KL_secendTextColor
                                              font:14
                                       isSizetoFit:NO
                                     textAlignment:NSTextAlignmentLeft];

    [self addSubview:self.desLable];
    
}
- (void)setModel:(KLDoctorModel *)model{
    _model = model;
    [self.iconButton sd_setBackgroundImageWithURL:[NSURL URLWithString:model.header] forState:UIControlStateNormal];
    self.titleLable.text = [NSString stringWithFormat:@"%@   %@",model.name,model.department];
    self.desLable.text = model.adept;
}
@end




